<html>
<head>
<title>The X Toolkit API</title>
<link href="doc.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
  google.load('visualization', '1', {packages: ['orgchart']});
</script>
<script type="text/javascript">

  // don't show internals by default
  var displayInternals = false;

  var toggleInternals = function() {
    
    // toggle the display variable
    displayInternals = !displayInternals;

    if (!document.styleSheets)
      return;
    var thecss = new Array();
    
    if (document.styleSheets[0].cssRules) thecss = document.styleSheets[0].cssRules;
    else thecss = document.styleSheets[0].rules;
    
    for (i = 0; i < thecss.length; i++) {
      
      if (thecss[i].selectorText.toLowerCase() == '.private') {
        
        if (displayInternals) {
          thecss[i].style.cssText += "display: block;";
          document.getElementById('togglBtn').innerHTML = 'Hide Internals'
        } else {
          thecss[i].style.cssText += "display: none;";
          document.getElementById('togglBtn').innerHTML = 'Show Internals'
        }
      
      } else if (thecss[i].selectorText.toLowerCase() == '.private_quicklink') {
        
        if (displayInternals) {
          thecss[i].style.cssText += "display: inline;";
        } else {
          thecss[i].style.cssText += "display: none;";
        }
        
      }
       
    }
    
  }
  
  function drawVisualization() {
    // Create and populate the data table.
    var data = google.visualization.arrayToDataTable([
      [{v:"goog.events.EventTarget",f:"<font color=green>goog.events.EventTarget</font>"},null,null],
["X.base","goog.events.EventTarget",null],
["X.scalars","X.base",null],
[{v:"X.loadable",f:"<font color=green>X.loadable</font>"},null,null],
["X.scalars","X.loadable",null],
[{v:"X.thresholdable",f:"<font color=green>X.thresholdable</font>"},null,null],
["X.scalars","X.thresholdable",null],

    ]);
  
    // Create and draw the visualization.
    new google.visualization.OrgChart(document.getElementById('diagram')).
        draw(data, {allowHtml: true, size:'small', color:'#f3f3f3'});
  }
  

  google.setOnLoadCallback(drawVisualization);  
  
</script>
</head>

<body>
	<h1>The X Toolkit API</h1>
	<div class="menu"><b>X</b><br><span class="menuitem"><a href="counter.html">X.counter</a></span><br><br><b>CORE</b><br><span class="menuitem"><a href="base.html">X.base</a></span><br><span class="menuitem"><a href="colortable.html">X.colortable</a></span><br><span class="menuitem"><a href="event.html">X.event</a></span><br><span class="menuitem"><a href="file.html">X.file</a></span><br><span class="menuitem"><a href="HoverEndEvent.html">X.HoverEndEvent</a></span><br><span class="menuitem"><a href="HoverEvent.html">X.HoverEvent</a></span><br><span class="menuitem"><a href="ModifiedEvent.html">X.ModifiedEvent</a></span><br><span class="menuitem"><a href="PanEvent.html">X.PanEvent</a></span><br><span class="menuitem"><a href="ProgressEvent.html">X.ProgressEvent</a></span><br><span class="menuitem"><a href="RenderEvent.html">X.RenderEvent</a></span><br><span class="menuitem"><a href="ResetViewEvent.html">X.ResetViewEvent</a></span><br><span class="menuitem"><a href="RotateEvent.html">X.RotateEvent</a></span><br><span class="menuitem"><a href="scalars.html">X.scalars</a></span><br><span class="menuitem"><a href="ScrollEvent.html">X.ScrollEvent</a></span><br><span class="menuitem"><a href="texture.html">X.texture</a></span><br><span class="menuitem"><a href="transform.html">X.transform</a></span><br><span class="menuitem"><a href="triplets.html">X.triplets</a></span><br><span class="menuitem"><a href="WindowLevelEvent.html">X.WindowLevelEvent</a></span><br><span class="menuitem"><a href="ZoomEvent.html">X.ZoomEvent</a></span><br><br><b>INJECTS</b><br><span class="menuitem"><a href="constructable.html">X.constructable</a></span><br><span class="menuitem"><a href="displayable.html">X.displayable</a></span><br><span class="menuitem"><a href="loadable.html">X.loadable</a></span><br><span class="menuitem"><a href="thresholdable.html">X.thresholdable</a></span><br><br><b>IO</b><br><span class="menuitem"><a href="interactor.html">X.interactor</a></span><br><span class="menuitem"><a href="interactor2D.html">X.interactor2D</a></span><br><span class="menuitem"><a href="interactor3D.html">X.interactor3D</a></span><br><span class="menuitem"><a href="loader.html">X.loader</a></span><br><span class="menuitem"><a href="parser.html">X.parser</a></span><br><span class="menuitem"><a href="parserCRV.html">X.parserCRV</a></span><br><span class="menuitem"><a href="parserDCM.html">X.parserDCM</a></span><br><span class="menuitem"><a href="parserFSM.html">X.parserFSM</a></span><br><span class="menuitem"><a href="parserIMAGE.html">X.parserIMAGE</a></span><br><span class="menuitem"><a href="parserLBL.html">X.parserLBL</a></span><br><span class="menuitem"><a href="parserLUT.html">X.parserLUT</a></span><br><span class="menuitem"><a href="parserMGZ.html">X.parserMGZ</a></span><br><span class="menuitem"><a href="parserNII.html">X.parserNII</a></span><br><span class="menuitem"><a href="parserNRRD.html">X.parserNRRD</a></span><br><span class="menuitem"><a href="parserOBJ.html">X.parserOBJ</a></span><br><span class="menuitem"><a href="parserSTL.html">X.parserSTL</a></span><br><span class="menuitem"><a href="parserTRK.html">X.parserTRK</a></span><br><span class="menuitem"><a href="parserVTK.html">X.parserVTK</a></span><br><br><b>MATH</b><br><span class="menuitem"><a href="array.html">X.array</a></span><br><span class="menuitem"><a href="matrix.html">X.matrix</a></span><br><span class="menuitem"><a href="vector.html">X.vector</a></span><br><br><b>OBJECTS</b><br><span class="menuitem"><a href="cube.html">X.cube</a></span><br><span class="menuitem"><a href="cylinder.html">X.cylinder</a></span><br><span class="menuitem"><a href="fibers.html">X.fibers</a></span><br><span class="menuitem"><a href="labelmap.html">X.labelmap</a></span><br><span class="menuitem"><a href="mesh.html">X.mesh</a></span><br><span class="menuitem"><a href="object.html">X.object</a></span><br><span class="menuitem"><a href="slice.html">X.slice</a></span><br><span class="menuitem"><a href="sphere.html">X.sphere</a></span><br><span class="menuitem"><a href="volume.html">X.volume</a></span><br><br><b>UI</b><br><span class="menuitem"><a href="caption.html">X.caption</a></span><br><span class="menuitem"><a href="progressbar.html">X.progressbar</a></span><br><br><b>VISUALIZATION</b><br><span class="menuitem"><a href="buffer.html">X.buffer</a></span><br><span class="menuitem"><a href="camera.html">X.camera</a></span><br><span class="menuitem"><a href="camera2D.html">X.camera2D</a></span><br><span class="menuitem"><a href="camera3D.html">X.camera3D</a></span><br><span class="menuitem"><a href="indexer.html">X.indexer</a></span><br><span class="menuitem"><a href="renderer.html">X.renderer</a></span><br><span class="menuitem"><a href="renderer2D.html">X.renderer2D</a></span><br><span class="menuitem"><a href="renderer3D.html">X.renderer3D</a></span><br><span class="menuitem"><a href="shaders.html">X.shaders</a></span><br><br></div>
	<div id="diagram"></div>
	<div class="content">
		<h2>X.scalars</h2>
		<div class="public" id="scalars">
<pre>/**
* Create a container for a scalar array.
*
* @constructor
* @extends <a href="base.html">X.base</a>
* @mixin <a href="loadable.html">X.loadable</a>
* @mixin <a href="thresholdable.html">X.thresholdable</a>
*/</pre>
<span class="code">var s = new <span class="identifier">X.scalars()</span>;</span><br></div><div class="private" id="_array">
<pre>/**
* The array containing the scalars.
*
* @type {?Float32Array}
* @protected
*/</pre>
<span class="code">s.<span class="identifier">_array</span> = $_ARRAY;</span><br></div><div class="private" id="_classname">
<pre>/**
* The className of this class.
*
* @type {string}
* @protected
*/</pre>
<span class="code">s.<span class="identifier">_classname</span> = $_CLASSNAME;</span><br></div><div class="private" id="_dirty">
<pre>/**
* The 'dirty' flag of this object.
*
* @type {boolean}
* @protected
*/</pre>
<span class="code">s.<span class="identifier">_dirty</span> = $_DIRTY;</span><br></div><div class="private" id="_file">
<pre>/**
* The file of this loadable object.
*
* @type {?<a href="file.html">X.file</a>}
* @protected
*/</pre>
<span class="code">s.<span class="identifier">_file</span> = $_FILE;</span><br></div><div class="private" id="_filedata">
<pre>/**
* The file data.
*
* @type {?ArrayBuffer}
* @protected
*/</pre>
<span class="code">s.<span class="identifier">_filedata</span> = $_FILEDATA;</span><br></div><div class="private" id="_glArray">
<pre>/**
* The WebGL-ready version of the scalars array.
*
* @type {?Float32Array}
* @protected
*/</pre>
<span class="code">s.<span class="identifier">_glArray</span> = $_GLARRAY;</span><br></div><div class="private" id="_id">
<pre>/**
* The uniqueId of this instance. Each class instance in XTK has a uniqueId.
*
* @type {number}
* @protected
*/</pre>
<span class="code">s.<span class="identifier">_id</span> = $_ID;</span><br></div><div class="private" id="_interpolation">
<pre>/**
* The interpolation scheme for this object.
* 	0 -	linear interpolation across range from minColor to maxColor
* 	1 - FreeSurfer curvature convention: negative values are interpolated
* 	    over minColor range, positive curvatures separately over
* 	    maxColor range.
*
* @type {!number}
* @protected
*/</pre>
<span class="code">s.<span class="identifier">_interpolation</span> = $_INTERPOLATION;</span><br></div><div class="private" id="_lowerThreshold">
<pre>/**
* The lower threshold.
*
* @type {number}
* @protected
*/</pre>
<span class="code">s.<span class="identifier">_lowerThreshold</span> = $_LOWERTHRESHOLD;</span><br></div><div class="private" id="_max">
<pre>/**
* The upper threshold border.
*
* @type {number}
* @protected
*/</pre>
<span class="code">s.<span class="identifier">_max</span> = $_MAX;</span><br></div><div class="private" id="_maxColor">
<pre>/**
* The color to map the max. scalar.
*
* @type {!Array}
* @protected
*/</pre>
<span class="code">s.<span class="identifier">_maxColor</span> = $_MAXCOLOR;</span><br></div><div class="private" id="_min">
<pre>/**
* The lower threshold border.
*
* @type {number}
* @protected
*/</pre>
<span class="code">s.<span class="identifier">_min</span> = $_MIN;</span><br></div><div class="private" id="_minColor">
<pre>/**
* The color to map the min. scalar.
*
* @type {!Array}
* @protected
*/</pre>
<span class="code">s.<span class="identifier">_minColor</span> = $_MINCOLOR;</span><br></div><div class="private" id="_replaceMode">
<pre>/**
* Flag to replace the colors after thresholding. If FALSE, discard the
* vertex.
*
* @type {boolean}
* @protected
*/</pre>
<span class="code">s.<span class="identifier">_replaceMode</span> = $_REPLACEMODE;</span><br></div><div class="private" id="_upperThreshold">
<pre>/**
* The upper threshold.
*
* @type {number}
* @protected
*/</pre>
<span class="code">s.<span class="identifier">_upperThreshold</span> = $_UPPERTHRESHOLD;</span><br></div><div class="public" id="array_get">
<pre>/**
* Get the array containing the scalars. This array is 'WebGL-ready', meaning
* that all values are represented by 3 elements to match the X,Y,Z coordinates
* of points.
*
* @public
*/</pre>
<span class="code">var _array = s.<span class="identifier">array</span>;</span><br></div><div class="public" id="array_set">
<pre>/**
* Set the array containing the scalars. This array has to be WebGL-ready
* meaning that it has to match <a href="object.html">X.object</a>.points.length, which equals 3 entries
* for each vertex (X,Y,Z coordinates). Calling this method marks this object as
* dirty so the <a href="renderer.html">X.renderer</a> can pick it up. This method should be used
* externally.
*
* @param {Array} array The WebGL-ready array matching <a href="object.html">X.object</a>._points.length
*          in size.
* @public
*/</pre>
<span class="code">s.<span class="identifier">array</span> = $ARRAY;</span><br></div><div class="public" id="classname_get">
<pre>/**
* Get the className of this object.
*
* @return {string} The className of this object.
* @public
*/</pre>
<span class="code">var _classname = s.<span class="identifier">classname</span>;</span><br></div><div class="public" id="file_get">
<pre>/**
* Get the associated <a href="file.html">X.file</a> for this object.
*
* @return {string} The associated file path or null if no file is associated.
*/</pre>
<span class="code">var _file = s.<span class="identifier">file</span>;</span><br></div><div class="public" id="file_set">
<pre>/**
* Load this object from a file path or reset the associated file path.
*
* @param {?string|Array} filepath The file path/URL to load. If null, reset the
*          associated file. If an array is given, load multiple files (this
*          only works for DICOM so far).
*/</pre>
<span class="code">s.<span class="identifier">file</span> = $FILEPATH;</span><br></div><div class="public" id="filedata_get">
<pre>/**
* Get the possibly attached file data for this object.
*
* @return {?string} The associated file data or null if none is attached.
*/</pre>
<span class="code">var _filedata = s.<span class="identifier">filedata</span>;</span><br></div><div class="public" id="filedata_set">
<pre>/**
* Set raw file data for this object. Doing so, skips any additional loading and
* just parses this raw data.
*
* @param {?string|Array} filedata The raw file data to parse.
*/</pre>
<span class="code">s.<span class="identifier">filedata</span> = $FILEDATA;</span><br></div><div class="public" id="id_get">
<pre>/**
* Get the id of this instance.
*
* @return {string} The className of this object.
* @public
*/</pre>
<span class="code">var _id = s.<span class="identifier">id</span>;</span><br></div><div class="public" id="interpolation_get">
<pre>/**
* The scalar interpolation associated with this object.
* The interpolation scheme for this object.
* 	0 -	linear interpolation across range from minColor to maxColor
* 	1 - FreeSurfer curvature convention: negative values are interpolated
* 	    over minColor range, positive curvatures separately over
* 	    maxColor range.
*
* @return {!number} The scalarInterpolation variable.
*/</pre>
<span class="code">var _interpolation = s.<span class="identifier">interpolation</span>;</span><br></div><div class="public" id="interpolation_set">
<pre>/**
* scalarsInterpolation
* The interpolation scheme for this object.
* 	0 -	linear interpolation across range from minColor to maxColor
* 	1 - FreeSurfer curvature convention: negative values are interpolated
* 	    over minColor range, positive curvatures separately over
* 	    maxColor range.
*
* @param {!number} value The interpolation scheme.
*
*/</pre>
<span class="code">s.<span class="identifier">interpolation</span> = $VALUE;</span><br></div><div class="public" id="lowerThreshold_get">
<pre>/**
* Get the lower threshold.
*
* @return {number} The lower threshold.
* @public
*/</pre>
<span class="code">var _lowerThreshold = s.<span class="identifier">lowerThreshold</span>;</span><br></div><div class="public" id="lowerThreshold_set">
<pre>/**
* Set the lower threshold if it is inside the min-max range.
*
* @param {number} lowerThreshold
* @public
*/</pre>
<span class="code">s.<span class="identifier">lowerThreshold</span> = $LOWERTHRESHOLD;</span><br></div><div class="public" id="maxColor_get">
<pre>/**
* Get the max color which is used to map the scalars to colors in a linear
* fashion.
*
* @return {!Array} An array holding the r,g,b components of the color.
* @public
*/</pre>
<span class="code">var _maxColor = s.<span class="identifier">maxColor</span>;</span><br></div><div class="public" id="maxColor_set">
<pre>/**
* Set the max color to linear map the scalars to colors.
*
* @param {!Array} maxColor The color corresponding to the min. scalar value.
* @public
*/</pre>
<span class="code">s.<span class="identifier">maxColor</span> = $MAXCOLOR;</span><br></div><div class="public" id="max_get">
<pre>/**
* Get the upper threshold border.
*
* @return {number} The upper threshold border.
* @public
*/</pre>
<span class="code">var _max = s.<span class="identifier">max</span>;</span><br></div><div class="public" id="minColor_get">
<pre>/**
* Get the min color which is used to map the scalars to colors in a linear
* fashion.
*
* @return {!Array} An array holding the r,g,b components of the color.
* @public
*/</pre>
<span class="code">var _minColor = s.<span class="identifier">minColor</span>;</span><br></div><div class="public" id="minColor_set">
<pre>/**
* Set the min color to linear map the scalars to colors.
*
* @param {!Array} minColor The color corresponding to the min. scalar value.
* @public
*/</pre>
<span class="code">s.<span class="identifier">minColor</span> = $MINCOLOR;</span><br></div><div class="public" id="min_get">
<pre>/**
* Get the lower threshold border.
*
* @return {number} The lower threshold border.
* @public
*/</pre>
<span class="code">var _min = s.<span class="identifier">min</span>;</span><br></div><div class="public" id="upperThreshold_get">
<pre>/**
* Get the upper threshold.
*
* @return {number} The upper threshold.
* @public
*/</pre>
<span class="code">var _upperThreshold = s.<span class="identifier">upperThreshold</span>;</span><br></div><div class="public" id="upperThreshold_set">
<pre>/**
* Set the upper threshold if it is inside the min-max range.
*
* @param {number} upperThreshold
* @public
*/</pre>
<span class="code">s.<span class="identifier">upperThreshold</span> = $UPPERTHRESHOLD;</span><br></div>
	</div>

  <div id="toolbox">
  <center><button id="togglBtn" type="button" onclick="javascript:toggleInternals();">Show Internals</button></center><br><br>
  <b>CONSTRUCTORS</b><br>
  <span class="public_quicklink"><a href="#scalars">X.scalars</a><br></span><br>
  <b>PROPERTIES</b><br>
  <span class="private_quicklink"><a href="#_array">_array</a><br></span><span class="private_quicklink"><a href="#_classname">_classname</a><br></span><span class="private_quicklink"><a href="#_dirty">_dirty</a><br></span><span class="private_quicklink"><a href="#_file">_file</a><br></span><span class="private_quicklink"><a href="#_filedata">_filedata</a><br></span><span class="private_quicklink"><a href="#_glArray">_glArray</a><br></span><span class="private_quicklink"><a href="#_id">_id</a><br></span><span class="private_quicklink"><a href="#_interpolation">_interpolation</a><br></span><span class="private_quicklink"><a href="#_lowerThreshold">_lowerThreshold</a><br></span><span class="private_quicklink"><a href="#_max">_max</a><br></span><span class="private_quicklink"><a href="#_maxColor">_maxColor</a><br></span><span class="private_quicklink"><a href="#_min">_min</a><br></span><span class="private_quicklink"><a href="#_minColor">_minColor</a><br></span><span class="private_quicklink"><a href="#_replaceMode">_replaceMode</a><br></span><span class="private_quicklink"><a href="#_upperThreshold">_upperThreshold</a><br></span><br>
  <b>GETTERS/SETTERS</b><br>
  <span class="public_quicklink"><a href="#array_get">array</a><br></span><span class="public_quicklink"><a href="#classname_get">classname</a><br></span><span class="public_quicklink"><a href="#file_get">file</a><br></span><span class="public_quicklink"><a href="#filedata_get">filedata</a><br></span><span class="public_quicklink"><a href="#id_get">id</a><br></span><span class="public_quicklink"><a href="#interpolation_get">interpolation</a><br></span><span class="public_quicklink"><a href="#lowerThreshold_get">lowerThreshold</a><br></span><span class="public_quicklink"><a href="#maxColor_get">maxColor</a><br></span><span class="public_quicklink"><a href="#max_get">max</a><br></span><span class="public_quicklink"><a href="#minColor_get">minColor</a><br></span><span class="public_quicklink"><a href="#min_get">min</a><br></span><span class="public_quicklink"><a href="#upperThreshold_get">upperThreshold</a><br></span><br>
  <b>FUNCTIONS</b><br>
  <br>
  <b>STATIC</b><br>
  <br><br><br>
  <center><small><a href="https://github.com/xtk/X/blob/master/core/scalars.js" target="_blank">SOURCECODE</a><br></small></center>
  </div>	
	
	<br><br><br>
</body>

</html>